package com.company.eos.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 登录授权
 * @TableName tb_login_author
 */
@TableName(value ="tb_login_author")
@Data
public class LoginAuthor implements Serializable {
    /**
     * ID标识
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 用户密码;密码，用加密字段存储
     */
    private String password;

    /**
     * SALT值;加盐值
     */
    private String salt;

    /**
     * 登录账户;可以为邮箱、手机号、工号、身份证号等
     */
    private String loginAccount;

    /**
     * 用户ID;对应的登录用户ID，从员工表获取
     */
    private Integer userId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public LoginAuthor() {
    }

    public LoginAuthor(String password, String salt, String loginAccount, Integer userId) {
        this.password = password;
        this.salt = salt;
        this.loginAccount = loginAccount;
        this.userId = userId;
    }

    public LoginAuthor(Integer id, String password, String salt, String loginAccount, Integer userId) {
        this.id = id;
        this.password = password;
        this.salt = salt;
        this.loginAccount = loginAccount;
        this.userId = userId;
    }
}
